﻿{layout:default} {class:Shop.Admin.Config.EmailJob}
<lbhead>
    <title><%=Tag("邮件队列")%>-<%=site.title%></title>
</lbhead>
<lbpath>
<style type="text/css">.mainbody_top{display:none;height:0;overflow:hidden}</style>
    <div class="tools">
    <ul>
    <%if (PageReturnMsg == ""){%>
    <li class="del"><a href="javascript:void(0);" onclick="DeleteObj();"><b></b><span><%=Tag("删除")%></span></a></li>
    <%}%>
    <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <%=Tag("邮件队列")%></span></li>
    </ul>
    </div>
</lbpath>
<lbbody>
    <table id="list" class="datalist">
        <tr class="title">
            <th style="width: 40px" class="selectAll">
                <a href="javascript:void(0);" onclick="$('input[name=\'id\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
            </th>
            <th style="width: 130px">
                <%=Tag("邮箱")%>
            </th>
            <th style="width: 130px">
                <%=Tag("用户")%>
            </th>
            <th >
                <%=Tag("主题")%>
            </th>
            <th style="width: 80px">
                <%=Tag("状态")%>
            </th>
            <th style="width: 130px">
                <%=Tag("任务时间")%>
            </th>
            <th style="width: 130px">
                <%=Tag("发送时间")%>
            </th>
            <th style="width: 100px">
                <%=Tag("操作")%>
            </th>
        </tr>
        <%foreach (Shop.Model.Lebi_Email model in models)
          {%>
        <tr class="list" ondblclick="EditObj(<%=model.id %>);" >
            <td style="text-align:center">
                <input type="checkbox" name="id" del="true" value="<%=model.id %>" />
                <input type="hidden" name="IDS" shop="true" value="<%=model.id %>" />
            </td>
            <td>
                <%=model.Email%>
            </td>
            <td>
                <%=model.User_Name%>
            </td>
            <td>
                <a href="javascript:void(0)" onclick="EditObj(<%=model.id %>);"><%=model.Title%></a>
            </td>
            <td>
                <%=Shop.Bussiness.EX_Type.TypeName(model.Type_id_EmailStatus)%>
            </td>
            <td>
                <%=FormatTime(model.Time_Task)%>
            </td>
            <td>
                <%=model.Type_id_EmailStatus==271?FormatTime(model.Time_Send):""%>
            </td>
            <td>
                <%if (model.Type_id_EmailStatus == 270){ %>
                <a href="javascript:void(0)" onclick="Send(<%=model.id %>);"><%=Tag("发送")%></a> |
                
                <%} %>
                <a href="javascript:void(0)" onclick="EditObj(<%=model.id %>);"><%=Tag("查看")%></a>
            </td>
        </tr>
        <%} %>
    </table>
    <script type="text/javascript">
        function EditObj(id) {
            var title_ = "<%=Tag("查看")%>";
            var url_ = "emailjob_edit_window.aspx?id=" + id;
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Send(id) {
            var postData ={"id":id};
            var url = "<%=site.AdminPath %>/ajax/ajax_site.aspx?__Action=Email_send";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("发送成功")%>", "?")});
        }
        function DeleteObj() {
            if (!confirm("<%=Tag("确认要删除吗？")%>"))
                return false;
            var postData = GetFormJsonData("del");
            var url = "<%=site.AdminPath %>/ajax/ajax_site.aspx?__Action=Email_del";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
    </script>
</lbbody>
<lbbottom>
<div class="bottom" id="body_bottom">
    <%=PageString%>
</div>
</lbbottom>